package com.akkainaction.mailbox.custommailbox.mail;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.dispatch.MailboxType;
import akka.dispatch.MessageQueue;
import akka.dispatch.ProducesMessageQueue;
import com.akkainaction.mailbox.custommailbox.queue.BusinessMsgQueue;
import com.typesafe.config.Config;
import scala.Option;

public class BusinessMailBoxType implements MailboxType, ProducesMessageQueue<BusinessMsgQueue> {

    /**
     * 这里要注意的是，定义邮箱类型时必须给出一个公开的，带有ActorSystem、Settings这两个类型参数的构造方法，否则会创建失败。
     * @param settings
     * @param config
     */
    public BusinessMailBoxType(ActorSystem.Settings settings, Config config) {

    }

    @Override
    public MessageQueue create(Option<ActorRef> option0, Option<ActorSystem> option1) {
        return new BusinessMsgQueue();
    }
}
